/**
 * Created by zlp on 2017-12-27.
 *
 */

let express = require('express');
let router =  express.Router();
let auth = require("../../app/controller/middleware/auth");
let pages = require("../../app/controller/prod/pages");
let sale = require("../../app/controller/prod/sale")

/*router.get(['*'],auth.auth)*/
router.get('/', function(req, res) {
    res.redirect('/sale/login');
});

router.get("/login",pages.sale.login);
router.post("/signup",sale.signup);//用户登录
router.post("/logout",sale.logout);//用户登出
router.post("/update/password",sale.update_password);//修改密码

router.get("/password/retrieve",pages.sale.retrieve);
router.get("/password/retrieve/reset",pages.sale.retrieve_reset);

router.post("/login/password/retrieve",sale.retrieve);
router.post("/login/password/retrieve/reset",sale.retrieve_reset);

//个人资料
router.get("/userinfo",pages.sale.userinfo);

//客户管理
router.get("/customer",pages.sale.custpage);
router.post("/customer/list",sale.saleCust.cust_list);
router.post("/customer/detail",sale.saleCust.cust_detail);

//提成管理
router.get("/deduct",pages.sale.deductpage);
router.get("/deduct/list",sale.sale_deduct.deduct);
router.get("/deduct/detail",sale.sale_deduct.deduct_detail);

module.exports = router;